export enum DIMENSION {
  '默认维度' = 'sd',
  '切换维度' = 'ds',
}

export enum DIMENSION96 {
  '默认维度' = 'sdn',
  '切换维度' = 'ns',
}

export const FIRELOW = 394.9;

export const SELECT_DATA: string[] = ['交易单元', '日期', '时点'];

export const SORT = {
  desc: 'desc',
  asc: 'asc',
};

export const indexMap: any = {
  totalStatementQuantity: { name: '综合电量', type: 'bar', color: '#5795CD' },
  totalStatementEnergyPrice: {
    name: '综合电价',
    type: 'line',
    color: '#E6E963',
    props: { symbol: 'circle' },
  },
  _averagePrice: {
    name: '算术均价',
    type: 'dashed',
    color: '#F6925A',
    props: {
      symbol: 'circle',
    },
  },
  // baseQuantity: { name: '基数电量', type: 'bar', color: '#00BF8F', props: { stack: 'one' } },
  longTermStatementQuantity: {
    name: '市场化中长期电量',
    type: 'bar',
    color: '#BFEBA2',
    props: { stack: 'one' },
  },
  spotSettlementElectricityQuantity: {
    name: '现货结算电量',
    type: 'line',
    props: { symbol: 'circle' },
    color: '#837ADC',
  },
  // provincialDayaheadClearingQuantity: {
  //   name: '日前出清电量',
  //   type: 'line',
  //   props: { symbol: 'circle' },
  //   color: '#67B2F7',
  // },
  /* provincialRealtimeClearingQuantity: {
    name: '实时计量电量',
    type: 'line',
    props: { symbol: 'circle' },
    color: '#837ADC',
  }, */
  totalLongTermStatementEnergyPrice: {
    name: '中长期综合电价',
    type: 'line',
    props: { symbol: 'circle' },
    color: '#2BDAE5',
  },
  provincialRealtimePurchasedPrice: {
    name: '实时买入电价',
    type: 'line',
    props: { symbol: 'circle' },
    color: '#E6E963',
  },
  provincialRealtimeSoldPrice: {
    name: '实时卖出电价',
    type: 'line',
    props: { symbol: 'circle' },
    color: '#18A0FB',
  },
  provincialDayaheadPurchasedPrice: {
    name: '日前买入电价',
    type: 'line',
    props: { symbol: 'circle' },
    color: '#F67E26',
  },
  provincialDayaheadSoldPrice: {
    name: '日前卖出电价',
    type: 'line',
    props: { symbol: 'circle' },
    color: '#30D485',
  },
  //子页面
  kValue: {
    name: '单元自身基数比例',
    type: 'line',
    props: { symbol: 'circle' },
    color: '#F6C826',
  },
  provincialDayaheadStatementPriceaheadStatementPrice: {
    name: '日前结算电价',
    type: 'line',
    color: '#2BDAE5',
    props: { symbol: 'circle' },
  },
  provincialRealtimeStatementPricetimeStatementPrice: {
    name: '实时结算电价',
    type: 'line',
    props: { symbol: 'circle' },
    color: '#E6E963',
  },
  _transitionPrice: {
    name: '过渡电价',
    type: 'line',
    props: { symbol: 'circle' },
    color: '#30D485',
  },
};
export const chartsMap = {
  场站总览: ['totalStatementQuantity', 'totalStatementEnergyPrice', '_averagePrice'],
  电量分析: [
    // 'baseQuantity',
    'longTermStatementQuantity',
    'spotSettlementElectricityQuantity',
    // 'provincialDayaheadClearingQuantity',
    // 'provincialRealtimeClearingQuantity',
  ],
  电价分析: [
    'totalStatementEnergyPrice',
    'totalLongTermStatementEnergyPrice',
    'provincialRealtimePurchasedPrice',
    'provincialRealtimeSoldPrice',
    'provincialDayaheadPurchasedPrice',
    'provincialDayaheadSoldPrice',
  ],
};

/**
 * 子页面
 * funcName //处理数据相应的方法
 * param //方法传入参数字段(字符串)
 * useData //是否依赖数据源 默认true
 * dependentValue  //依赖其他字段计算后的值
 */
// export const chartsMap_subpage = {
//   电量分析: {
//     baseQuantity: {
//       funcName: 'forMater',
//       param: ['baseQuantity'],
//     },
//     longTermStatementQuantity: {
//       funcName: 'forMater',
//       param: ['longTermStatementQuantity'],
//     },
//     // provincialDayaheadClearingQuantity: {
//     //   funcName: 'forMater',
//     //   param: ['provincialDayaheadClearingQuantity'],
//     // },
//     provincialRealtimeClearingQuantity: {
//       funcName: 'forMater',
//       param: ['provincialRealtimeClearingQuantity'],
//     },
//   },
//   基数分配比例: {
//     // gridBaseRatio: {
//     //   funcName: 'getGridBaseRatio',
//     // },
//     kValue: {
//       funcName: 'forMater',
//       param: ['kValue'],
//     },
//   },
//   结算电价分析: {
//     provincialDayaheadStatementPriceaheadStatementPrice: {
//       funcName: 'forMater',
//       param: ['provincialDayaheadStatementPrice'],
//     },
//     provincialRealtimeStatementPricetimeStatementPrice: {
//       funcName: 'forMater',
//       param: ['provincialRealtimeStatementPrice'],
//     },
//     _transitionPrice: {
//       funcName: 'forMater',
//       param: ['transitionPrice'],
//     },
//   },
// };

/**
 * 子页面 场站-日期-96/24点数据
 * funcName //处理数据相应的方法
 * param //方法传入参数字段(字符串)
 * useData //是否依赖数据源 默认true
 * dependentValue  //依赖其他字段计算后的值
 */
// export const chartsMap_subpage_isSDN = {
//   电量分析: {
//     baseQuantity: {
//       funcName: 'getEcharsData96',
//       param: ['baseQuantity', true],
//     },
//     longTermStatementQuantity: {
//       funcName: 'getEcharsData96',
//       param: ['longTermStatementQuantity', true],
//     },
//     // provincialDayaheadClearingQuantity: {
//     //   funcName: 'getEcharsData96',
//     //   param: ['provincialDayaheadClearingQuantity', true],
//     // },
//     provincialRealtimeClearingQuantity: {
//       funcName: 'getEcharsData96',
//       param: ['provincialRealtimeClearingQuantity', true],
//     },
//   },
//   基数分配比例: {
//     // gridBaseRatio: {
//     //   funcName: 'getGridBaseRatio',
//     // },
//     kValue: {
//       funcName: 'getPowerForecastPrice',
//       param: ['baseQuantity', 'provincialDayaheadClearingQuantity'],
//     },
//   },
//   结算电价分析: {
//     provincialDayaheadStatementPriceaheadStatementPrice: {
//       // 日前结算电价 = 选择天对应点 的日前结算电费之和 / 选择天对应点 的日前结算电量之和
//       funcName: 'getProvincialDayaheadStatementPrice96',
//     },
//     provincialRealtimeStatementPricetimeStatementPrice: {
//       // 实时结算电价  = 选择天对应点 的实时结算电费之和 / 选择天对应点 的实时结算电量之和
//       funcName: 'getProvincialRealtimeStatementPrice96',
//     },
//     _transitionPrice: {
//       // 过渡电价 = k值 *332 （1-K值）*日前结算电价
//       funcName: 'getTransitionPrice96',
//       dependentValue: 'provincialDayaheadStatementPriceaheadStatementPrice',
//     },
//   },
// };
//需要展示双Y轴的图表
export const Doubel_yAxis_title = ['场站总览', '电量分析', '电价分析'];

//需要展示双Y轴的serise字段
export const Doubel_yAxis_serise = [
  'totalStatementEnergyPrice',
  '_averagePrice',
  'spotSettlementElectricityQuantity',
  // 'provincialRealtimeClearingQuantity',
  'totalStatementEnergyPrice',
];

export const liaoNingTableHead = [
  /* {
    field: 'provincialRealtimeClearingQuantity',
    name: '实时计量电量',
    parentName: '综合统计',
  }, */
  {
    field: 'totalStatementEnergyIncome',
    name: '综合电费',
    parentName: '综合统计',
  },
  {
    field: 'totalStatementQuantity',
    name: '综合电量',
    parentName: '综合统计',
  },
  {
    field: 'totalStatementEnergyPrice',
    name: '综合电价',
    parentName: '综合统计',
  },
  {
    field: 'totalLongTermStatementQuantity',
    name: '中长期总结算电量',
    parentName: '中长期统计',
  },
  {
    field: 'totalLongTermStatementEnergyPrice',
    name: '中长期综合电价',
    parentName: '中长期统计',
  },
  {
    field: 'totalLongTermStatementEnergyIncome',
    name: '中长期总电费',
    parentName: '中长期统计',
  },
  {
    field: 'baseQuantity',
    name: '优发电量',
    parentName: '中长期统计',
  },
  {
    field: 'longTermStatementQuantity',
    name: '市场化中长期电量',
    parentName: '中长期统计',
  },
  {
    field: 'provincialRealtimeBaseQuantityRatio',
    name: '市场化中长期电价',
    parentName: '中长期统计',
  },
  {
    field: 'provincialDayaheadClearedOutQuantity',
    name: '日前出清电量',
    parentName: '日前统计',
  },
  {
    field: 'provincialDayaheadPurchasedQuantity',
    name: '日前买入电量',
    parentName: '日前统计',
  },
  {
    field: 'provincialDayaheadPurchasedPrice',
    name: '日前买入电价',
    parentName: '日前统计',
  },
  {
    field: 'provincialDayaheadSoldQuantity',
    name: '日前卖出电量',
    parentName: '日前统计',
  },
  {
    field: 'provincialDayaheadSoldPrice',
    name: '日前卖出电价',
    parentName: '日前统计',
  },
  {
    field: 'provincialDayaheadStatementQuantity',
    name: '日前综合结算电量',
    parentName: '日前统计',
  },
  // {
  //   field: 'provincialDayaheadClearingQuantity',
  //   name: '日前结算电量',
  //   parentName: '日前统计',
  // },
  {
    field: 'provincialDayaheadStatementIncome',
    name: '日前综合结算电费',
    parentName: '日前统计',
  },
  {
    field: 'provincialDayaheadStatementPrice',
    name: '日前综合电价',
    parentName: '日前统计',
  },
  {
    field: 'provincialRealtimeClearingOutQuantity',
    name: '实时出清电量',
    parentName: '实时统计',
  },
  {
    field: 'provincialRealtimePurchasedQuantity',
    name: '实时买入电量',
    parentName: '实时统计',
  },
  {
    field: 'provincialRealtimePurchasedPrice',
    name: '实时买入电价',
    parentName: '实时统计',
  },
  {
    field: 'provincialRealtimeSoldQuantity',
    name: '实时卖出电量',
    parentName: '实时统计',
  },
  {
    field: 'provincialRealtimeSoldPrice',
    name: '实时卖出电价',
    parentName: '实时统计',
  },
  {
    field: 'provincialRealtimeStatementQuantity',
    name: '实时综合结算电量',
    parentName: '实时统计',
  },
  {
    field: 'provincialRealtimeStatementIncome',
    name: '实时综合结算电费',
    parentName: '实时统计',
  },
  {
    field: 'provincialRealtimeStatementPrice',
    name: '实时综合电价',
    parentName: '实时统计',
  },
  {
    field: 'blockageMediumLongTermContracts',
    name: '中长期合约阻塞',
    parentName: '阻塞及偏差',
  },
  {
    field: 'blockageNewEnergyPowerPrediction',
    name: '新能源功率预测偏差考核费用',
    parentName: '阻塞及偏差',
  },
  {
    field: 'blockageMediumLongVacancyAssessment',
    name: '发电侧中长期缺额考核',
    parentName: '阻塞及偏差',
  },
  {
    field: 'blockageNewEnergyPowerExcessProfitRecovery',
    name: '新能源超额获利回收',
    parentName: '阻塞及偏差',
  },
];

export const liaoningHeaderMap = liaoNingTableHead.reduce(
  (a: any, b: any) => {
    a[b.parentName + '-' + b.name] = b.field;
    return a;
  },
  //表格未展示字段
  { 装机容量: 'installedCapacity', 标杆电价: 'benchmarkElectricityPrice' },
);

export const liaoNingTableHead1 = [
  /* {
    field: 'provincialRealtimeClearingQuantity',
    name: '实时计量电量',
    parentName: '综合统计',
  }, */
  {
    field: 'totalStatementEnergyIncome',
    name: '综合电费',
    parentName: '综合统计',
  },
  {
    field: 'totalStatementQuantity',
    name: '综合电量',
    parentName: '综合统计',
  },
  {
    field: 'totalStatementEnergyPrice',
    name: '综合电价',
    parentName: '综合统计',
  },
  {
    field: 'totalLongTermStatementQuantity',
    name: '中长期总结算电量',
    parentName: '中长期统计',
  },
  {
    field: 'totalLongTermStatementEnergyPrice',
    name: '中长期综合电价',
    parentName: '中长期统计',
  },
  {
    field: 'totalLongTermStatementEnergyIncome',
    name: '中长期总电费',
    parentName: '中长期统计',
  },
  {
    field: 'baseQuantity',
    name: '优发电量',
    parentName: '中长期统计',
  },
  {
    field: 'longTermStatementQuantity',
    name: '市场化中长期电量',
    parentName: '中长期统计',
  },
  {
    field: 'provincialRealtimeBaseQuantityRatio',
    name: '市场化中长期电价',
    parentName: '中长期统计',
  },
  {
    field: 'provincialDayaheadClearedOutQuantity',
    name: '日前出清电量',
    parentName: '日前统计',
  },
  {
    field: 'provincialDayaheadPurchasedQuantity',
    name: '日前买入电量',
    parentName: '日前统计',
  },
  {
    field: 'provincialDayaheadPurchasedPrice',
    name: '日前买入电价',
    parentName: '日前统计',
  },
  {
    field: 'provincialDayaheadSoldQuantity',
    name: '日前卖出电量',
    parentName: '日前统计',
  },
  {
    field: 'provincialDayaheadSoldPrice',
    name: '日前卖出电价',
    parentName: '日前统计',
  },
  {
    field: 'provincialDayaheadStatementQuantity',
    name: '日前综合结算电量',
    parentName: '日前统计',
  },
  // {
  //   field: 'provincialDayaheadClearingQuantity',
  //   name: '日前结算电量',
  //   parentName: '日前统计',
  // },
  {
    field: 'provincialDayaheadStatementIncome',
    name: '日前综合结算电费',
    parentName: '日前统计',
  },
  {
    field: 'provincialDayaheadStatementPrice',
    name: '日前综合电价',
    parentName: '日前统计',
  },
  {
    field: 'provincialRealtimeClearingOutQuantity',
    name: '实时出清电量',
    parentName: '实时统计',
  },
  {
    field: 'provincialRealtimePurchasedQuantity',
    name: '实时买入电量',
    parentName: '实时统计',
  },
  {
    field: 'provincialRealtimePurchasedPrice',
    name: '实时买入电价',
    parentName: '实时统计',
  },
  {
    field: 'provincialRealtimeSoldQuantity',
    name: '实时卖出电量',
    parentName: '实时统计',
  },
  {
    field: 'provincialRealtimeSoldPrice',
    name: '实时卖出电价',
    parentName: '实时统计',
  },
  {
    field: 'provincialRealtimeStatementQuantity',
    name: '实时综合结算电量',
    parentName: '实时统计',
  },
  {
    field: 'provincialRealtimeStatementIncome',
    name: '实时综合结算电费',
    parentName: '实时统计',
  },
  {
    field: 'provincialRealtimeStatementPrice',
    name: '实时综合电价',
    parentName: '实时统计',
  },
  // 测算1 偏差 暂不开发
  {
    field: 'deviation',
    name: '偏差',
    parentName: ' ',
  },
];

export const liaoningHeaderMap1 = liaoNingTableHead1.reduce(
  (a: any, b: any) => {
    if (b.parentName == ' ') {
      a[b.name] = b.field;
      return a;
    }
    a[b.parentName + '-' + b.name] = b.field;
    return a;
  },
  //表格未展示字段
  { 装机容量: 'installedCapacity', 标杆电价: 'benchmarkElectricityPrice' },
);

export const OPTION_KEY = {
  交易单元: 'stationName',
  日期: 'date',
  时点: 'timeOrder',
};
